class Request {
  constructor() {
    this.baseURL = 'http://localhost:8088'
  }

  post(url, data) {
    return new Promise((resolve, reject) => {
      uni.request({
        url: this.baseURL + url,
        method: 'POST',
        data,
        header: { 'Content-Type': 'application/json' },
        success: (res) => resolve(res.data),
        fail: (err) => reject(err)
      })
    })
  }
}

// 导出实例
export default new Request()